package com.keshan.service.impl;

import com.keshan.mapper.WearDeviceMapper;
import com.keshan.pojo.WearDevice;
import com.keshan.pojo.WearDeviceExample;
import com.keshan.service.WearDeviceServices;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author keshan
 * @date 2022/10/21 - 19:58
 */
@Service
public class WearDeviceServicesImpl implements WearDeviceServices {
    @Autowired
    WearDeviceMapper wearDeviceMapper;
    @Override
    public int insertBySelectiveWearDevice(WearDevice wearDevice) {
        return wearDeviceMapper.insertSelective(wearDevice);
    }

    @Override
    public List<WearDevice> getWearDeviceListByImei(String imei) {
        WearDeviceExample wearDeviceExample = new WearDeviceExample();
        WearDeviceExample.Criteria criteria = wearDeviceExample.createCriteria();
        criteria.andImeiEqualTo(imei);
        return wearDeviceMapper.selectByExample(wearDeviceExample);
    }
}
